Health text improvements - #2
Open
KharchenkoDmitriy wants to merge 3 commits into
Open
Conversation
Adds a colorByHealth toggle for the health1/health2/shields/healAbsorbs health text segments: when enabled, the segment's color blends from red (low health) to yellow to its normal base color as health rises, instead of a static baked-in color.
F.FormatNumber now takes an optional decimals argument (defaults to 1, matching prior behavior for backward compatibility). Adds "_short2" format entries and matching dropdown options for health/deficit/ effective/shields/heal-absorb text, so users can opt into 2-decimal precision (e.g. 12.34K) per segment instead of the default 1 decimal.
The deficit/deficit_short/deficit_short2/deficit_percent formats now suppress their output once a unit is topped off, instead of always showing "-0"/"0%". Controlled per-segment by the segment's existing (previously unused) hideIfEmptyOrFull setting, now with a real checkbox in the health text settings. Defaults to hidden for new layouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three related improvements to the health text indicator (Health 1/2, Shields, Heal Absorbs):
12.3K) can now be shown with 2 decimals (12.34K) instead of 1, as an explicit per-segment dropdown option alongside the existing 1-decimal format. The original 1-decimal formats are unchanged, so existing layouts render identically.-0/0%once a unit is topped off. This reuses ahideIfEmptyOrFullfield that already existed in the saved layout schema but was never actually wired up for health text. New layouts default to hiding it; existing layouts get a checkbox to opt in.Changes by commit
Add ElvUI-style health-by-color gradient text optionF.GetHealthTextColorhelper inUtils.lua(wraps the existingF.ColorGradient).colorByHealthtoggle added to health1/health2/shields/healAbsorbs segment config, with a checkbox next to each segment's color picker in the indicator settings UI.Add 2-decimal option for abbreviated health textF.FormatNumbernow takes an optionaldecimalsargument (default1, matching prior behavior).*_short2format variants (health/deficit/effective/shields/heal-absorbs) selectable from each segment's format dropdown, labeled with a(2 Decimals)tag.Hide deficit text at 0, with a toggle to always show ithideIfZeroflag and return an empty string when the computed deficit is 0.hideIfEmptyOrFullfield per health1/health2 segment (previously present in the saved-variables schema but unused everywhere except a no-op stub on Power Text).Test plan
-0/0%shows again at full health.(2 Decimals)format option and confirm the abbreviated number shows 2 decimal places; confirm the corresponding 1-decimal option is unchanged.